#include<stdio.h>

int main()
{
	int m,n,t;
	scanf("%d%d",&m,&n);
	int x=m,y=n;
	while(n!=0){
		t=m%n,m=n,n=t;
	}
	printf("%d\n%d",m,x/m*y);
	return 0;
}
